Support for Xen console ring output.
40c9c4688m3eqnC8fhLu1APm36VOVA tools/python/xen/xend/XendClient.py
40c9c468t6iIKTjwuYoe-UMCikDcOQ tools/python/xen/xend/XendConsole.py
40c9c468WnXs6eOUSff23IIGI4kMfQ tools/python/xen/xend/XendDB.py
+40eee3a0sPO-WUu34uHUXOC7HliDGw tools/python/xen/xend/XendDmesg.py
40c9c468fSl3H3IypyT0ppkbb0ZT9A tools/python/xen/xend/XendDomain.py
40c9c468bbKq3uC7_fuNUkiMMjArdw tools/python/xen/xend/XendDomainConfig.py
40c9c4685ykq87_n1kVUbMr9flx9fg tools/python/xen/xend/XendDomainInfo.py
40c9c468woSmBByfeXA4o_jGf2gCgA tools/python/xen/xend/server/SrvDaemon.py
40c9c468kACsmkqjxBWKHRo071L26w tools/python/xen/xend/server/SrvDeviceDir.py
40c9c468EQZJVkCLds-OhesJVVyZbQ tools/python/xen/xend/server/SrvDir.py
+40eee3a0m38EwYXfCSFIjWNwG6jx_A tools/python/xen/xend/server/SrvDmesg.py
40c9c468TyHZUq8sk0FF_vxM6Sozrg tools/python/xen/xend/server/SrvDomain.py
40c9c469WzajDjutou3X7FmL9hMf3g tools/python/xen/xend/server/SrvDomainDir.py
40c9c469-8mYEJJTAR6w_ClrJRAfwQ tools/python/xen/xend/server/SrvEventDir.py
def eventurl(location, root, id=''):
return urljoin(location, root, 'event/', id)
+def dmesgurl(location, root, id=''):
+ return urljoin(location, root, 'dmesg/', id)
+
def xend_request(url, method, data=None):
urlinfo = urlparse.urlparse(url)
(uproto, ulocation, upath, uparam, uquery, ufrag) = urlinfo
def eventurl(self, id=''):
return eventurl(self.location, self.root, id)
+ def dmesgurl(self, id=''):
+ return dmesgurl(self.location, self.root, id)
+
def xend(self):
return xend_get(urljoin(self.location, self.root))
def xend_event_inject(self, sxpr):
val = xend_call(self.eventurl(),
{'op': 'inject', 'event': fileof(sxpr) })
+
+ def xend_dmesg(self):
+ return xend_get(self.dmesgurl())
def main(argv):
--- /dev/null
+# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
+
+"""Get dmesg output for this node. Very basic right now!
+"""
+
+import os
+import xen.lowlevel.xc
+
+class XendDmesg:
+ def __init__(self):
+ self.xc = xen.lowlevel.xc.new()
+
+ def info(self):
+ return [ self.xc.readconsolering() ]
+
+
+def instance():
+ global inst
+ try:
+ inst
+ except:
+ inst = XendDmesg()
+ return inst
+
--- /dev/null
+# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
+
+import os
+from SrvDir import SrvDir
+from xen.xend import sxp
+from xen.xend import XendDmesg
+
+class SrvDmesg(SrvDir):
+ """Xen Dmesg output.
+ """
+
+ def __init__(self):
+ SrvDir.__init__(self)
+ self.xd = XendDmesg.instance()
+
+ def render_GET(self, req):
+ if self.use_sxp(req):
+ req.setHeader("Content-Type", sxp.mime_type)
+ sxp.show(['dmesg'] + self.info(), out=req)
+ else:
+ req.write('<html><head></head><body>')
+ req.write('<pre>')
+ self.print_path(req)
+ req.write(self.info()[0])
+ req.write('</pre></body></html>')
+ return ''
+
+ def info(self):
+ return self.xd.info()
subdirs = [
('node', 'SrvNode' ),
('domain', 'SrvDomainDir' ),
+ ('dmesg', 'SrvDmesg' ),
('console', 'SrvConsoleDir' ),
('event', 'SrvEventDir' ),
('device', 'SrvDeviceDir' ),
xm.prog(ProgConsole)
+class ProgDmesg(Prog):
+ group = 'host'
+ name = "dmesg"
+ info = """Print Xen boot output."""
+
+ def main(self, args):
+ print server.xend_dmesg()[1]
+
+xm.prog(ProgDmesg)
+
def main(args):
xm.main(args)